module.exports = ctx => {
	return {
		base: '/cquery/',
		title: 'CQuery',
		description: '高效快速组件库',
		lang: 'zh-CN',
		head: [
			['script', { src: '/libs/cquery/cquery.js' }],
      ['link', { rel: 'stylesheet', href: '/libs/cquery/cquery.css' }],
      ['link', { rel: 'stylesheet', href: '/libs/layout.css' }],
			['script', { src: '/icon/iconfont.js' }],
			['link', { rel: 'stylesheet', href: '/icon/iconfont.css' }],
		],
		markdown: {
			lineNumbers: true, // 是否在每个代码块的左侧显示行号。
		},
		plugins: [
      [require('./plugins/demo-code')],
			// [
			// 	'vuepress-plugin-container',
			// 	{
			// 		type: 'demo',
			// 		defaultTitle: '',
			// 		before: info => `<demo-block><template>${info}</template>`,
			// 		after: '</demo-block>',
			// 	},
			// ],
			// ['@vuepress-reco/extract-code'],
		],
		themeConfig: {
			// logo: '/logo.png',
			nav: [
				{
					text: '首页',
					link: '/',
				},
				{
					text: '指南',
					link: '/guide/',
				},
				{
					text: '组件',
					link: '/components/',
				},
				{
					text: 'Languages',
					ariaLabel: 'Language Menu',
					items: [
						{ text: 'Chinese', link: '/language/chinese/' },
						{ text: 'English', link: '/language/english/' },
					],
				},
				{ text: 'Gitee', link: 'https://gitee.com/atwon/cquery', target: '_blank', rel: '' },
			],
			sidebar: {
				'/guide/': ['' /* /guide/ */, 'getting-started' /* /guide/使用.html */],
				'/components/': [
          {
            title: '全局组件',
            path: 'Theme',
            collapsable: false, // 可选的, 默认值是 true,
            children: ['Theme', 'Layout'],
          },
					{
						title: '基础组件', // 必要的
						path: 'Button', // 可选的, 标题的跳转链接，应为绝对路径且必须存在
						collapsable: false, // 可选的, 默认值是 true,
						sidebarDepth: 1, // 可选的, 默认值是 1
						children: ['Button', 'Input', 'Switch', 'Tabs', 'Accordion', 'Menu', 'Overlay', 'Popup'],
					},
					{
						title: '复合组件', // 必要的
            path: 'Article',
						collapsable: false,
						sidebarDepth: 1,
						children: ['Article', 'Navigation', 'Setting'],
					},
				],
			},
			activeHeaderLinks: false, // 默认值：true
			lastUpdated: 'Last Updated', // string | boolean
			smoothScroll: true,
		},
		configureWebpack: (config, isServer) => {
      return {
        resolve: {
          alias: {
            '@': 'docs/.vuepress',
          }
        }
      }
    },
	};
};
